//
//  C_wladdCell_1.m
//  Estate
//
//  Created by heyong on 16/6/16.
//  Copyright © 2016年 ttsx. All rights reserved.
//

#import "C_wladdCell_1.h"

@implementation C_wladdCell_1

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle=UITableViewCellSelectionStyleNone;
    self.title1.textColor=UIColorFromRGB(0x797979);
    self.title2.textColor=UIColorFromRGB(0x797979);
    self.text1.textColor=UIColorFromRGB(0x797979);
    self.text2.textColor=UIColorFromRGB(0x797979);
    self.title1.font=[UIFont systemFontOfSize:16*BIZ];
    self.title2.font=[UIFont systemFontOfSize:16*BIZ];
    self.text1.font=[UIFont systemFontOfSize:16*BIZ];
    self.text2.font=[UIFont systemFontOfSize:16*BIZ];
}

- (IBAction)text1:(UITextField *)sender {
    if(self.text1Block){
        self.text1Block(sender.text);
    }
}

- (IBAction)text2Change:(UITextField *)sender {
    if(self.text2Block){
        self.text2Block(sender.text);
    }
}

- (void)configTitle:(NSString *)title1 Andtitle2:(NSString *)title2 AndText1:(NSString *)text1 AndText2:(NSString *)text2 {
    
    self.title1.text=title1;
    self.title2.text=title2;
    self.text1.text=text1;
    self.text2.text=text2;
    self.text1.delegate=self;
    self.text2.delegate=self;
    
}


- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
    //   限制苹果系统输入法  禁止输入表情
    if ([[[UITextInputMode currentInputMode]primaryLanguage] isEqualToString:@"emoji"]) {
        return NO;
    }
    return YES;
}

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
    if (self.duban) {
        UIView *clickView = [[UIView alloc] initWithFrame:CGRectMake(self.text2.frame.origin.x, 0, self.text2.frame.size.width, self.frame.size.height)];
        [self.contentView addSubview:clickView];
        
        CGPoint pt = [self.contentView convertPoint:point toView:clickView];
        if ([clickView pointInside:pt withEvent:event]) {
            return [super hitTest:point withEvent:event];
        }
    } else {
        return [super hitTest:point withEvent:event];
    }
    return nil;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
